package com.an.redisl;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;
import java.io.Serializable;
import java.util.Date;

/**
 * ClassName: Customer <br/>
 * Function: 客户vo. <br/>
 * Reason: 客户vo. <br/>
 * date: 2016年9月21日 下午1:34:30 <br/>
 *
 * @author lhb
 * @version
 * @since JDK 1.7
 */
public class Customer implements Serializable {
  /**
   * serialVersionUID:序列化.
   *
   * @since JDK 1.7
   */
  private static final long serialVersionUID = 8100894802110648697L;
  /**
   * CUSTOMER_FLAG_BEGIN:客户号码标记头.
   * @since JDK 1.7
   */
  public static final String CUSTOMER_FLAG_BEGIN = "CUSTOMER_ID:";
  /**
   * CUSTOMER_FLAG_END:客户号码标记尾.
   * @since JDK 1.7
   */
  public static final String CUSTOMER_FLAG_END = ":PHONE_NUMBER";
  /**
   * DISABLE:客户停用.
   * @since JDK 1.7
   */
  public static final int DISABLE = 0;
  /**
   * ENABLE:客户启用.
   * @since JDK 1.7
   */
  public static final int ENABLE = 1;
  /**
   * objectMapper:Json对象模版.
   * @since JDK 1.7
   */
  private ObjectMapper objectMapper = new ObjectMapper();
  /**
   * customerId:客户id对应数据库customer_id.
   *
   * @since JDK 1.7
   */
  private String customerId;
  /**
   * customerName:客户name 对应数据了customer_name.
   *
   * @since JDK 1.7
   */
  private String customerName;
  /**
   * customerPhoneNumber:客户手机号对应数据库custome_phone_number.
   *
   * @since JDK 1.7
   */
  private String customerPhoneNumber;
  /**
   * customerEmail:客户email对应数据库customer_email.
   *
   * @since JDK 1.7
   */
  private String customerEmail;
  /**
   * openId:客户openid 对应数据库open_id.
   *
   * @since JDK 1.7
   */
  private String openId;
  /**
   * customerIp:客户ip 对应数据库customer_ip.
   *
   * @since JDK 1.7
   */
  private String customerIp;
  /**
   * customerSecret:客户密匙,对应数据库customer_secret.
   *
   * @since JDK 1.7
   */
  private String customerSecret;
  /**
   * status:客户状态,对应数据库status.
   *
   * @since JDK 1.7
   */
  private int status;
  /**
   * relatedUserId:关联用户id,对应数据库relted_user_id.
   *
   * @since JDK 1.7
   */
  private String relatedUserId;
  /**
   * createUserId:创建用户id,对应数据库create_user_id.
   *
   * @since JDK 1.7
   */
  private String createUserId;
  /**
   * createTime:创建时间,对应数据库create_time.
   *
   * @since JDK 1.7
   */
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
  private Date createTime;
  /**
   * relatedUserName:关联用户名称.
   *
   * @since JDK 1.7
   */
  private String relatedUserName;
  /**
   * createUserName:创建用户姓名.
   *
   * @since JDK 1.7
   */
  private String createUserName;
  /**
   * extraData:额外数据 字符串.
   * @since JDK 1.7
   */
  @JsonIgnore
  private String extraDataStr; 
  /**
   * serviceNodeGroupId:服务节点组ID.对应数据库service_node_group_id
   * @since JDK 1.7
   */
  private String serviceNodeGroupId;

  /**
   * Creates a new instance of Customer.
   *
   */
  public Customer() {
    super();
    // 设置字符串内容多余对象时，字符串转对象不失败
    objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
  }

  public String getRelatedUserName() {
    return relatedUserName;
  }

  public void setRelatedUserName(String relatedUserName) {
    this.relatedUserName = relatedUserName;
  }

  public String getCreateUserName() {
    return createUserName;
  }

  public void setCreateUserName(String createUserName) {
    this.createUserName = createUserName;
  }

  public String getCustomerId() {
    return customerId;
  }

  public void setCustomerId(String customerId) {
    this.customerId = customerId;
  }

  public String getCustomerName() {
    return customerName;
  }

  public void setCustomerName(String customerName) {
    this.customerName = customerName;
  }

  public String getCustomerPhoneNumber() {
    return customerPhoneNumber;
  }

  public void setCustomerPhoneNumber(String customerPhoneNumber) {
    this.customerPhoneNumber = customerPhoneNumber;
  }

  public String getCustomerEmail() {
    return customerEmail;
  }

  public void setCustomerEmail(String customerEmail) {
    this.customerEmail = customerEmail;
  }

  public String getOpenId() {
    return openId;
  }

  public void setOpenId(String openId) {
    this.openId = openId;
  }

  public String getCustomerIp() {
    return customerIp;
  }

  public void setCustomerIp(String customerIp) {
    this.customerIp = customerIp;
  }

  public String getCustomerSecret() {
    return customerSecret;
  }

  public void setCustomerSecret(String customerSecret) {
    this.customerSecret = customerSecret;
  }

  public int getStatus() {
    return status;
  }

  public void setStatus(int status) {
    this.status = status;
  }

  public String getRelatedUserId() {
    return relatedUserId;
  }

  public void setRelatedUserId(String relatedUserId) {
    this.relatedUserId = relatedUserId;
  }

  public String getCreateUserId() {
    return createUserId;
  }

  public void setCreateUserId(String createUserId) {
    this.createUserId = createUserId;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public String getExtraDataStr() {
    return extraDataStr;
  }


  public String getServiceNodeGroupId() {
    return serviceNodeGroupId;
  }

  public void setServiceNodeGroupId(String serviceNodeGroupId) {
    this.serviceNodeGroupId = serviceNodeGroupId;
  }
}
